/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ep.m008.ui.views;

import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComponentContainer;
import ep.libs.implementations.AbstractModule;
import ep.libs.implementations.AbstractView;
import ep.m001.ui.views.LoginView;
import ep.m002.module.M002Module;
import ep.m008.ui.controllers.M008Controller;

/**
 *
 * @author atsi
 */
public class M008View extends AbstractView {

    private M008Controller controller;
    private Button backButton;

    public M008View(AbstractModule module) {
        super(module);
    }

    public M008View(AbstractModule module, Object[] args) {
        super(module, args);
    }

    @Override
    public ComponentContainer getView() {
        controller = new M008Controller();
        initializeFormStrings();
        initializeComponents();
        initializeListeners();
        return viewLayout;
    }

    public void initializeComponents() {
        backButton = new Button("Επιστροφή");
        viewLayout.addComponent(backButton);

    }

    private void initializeListeners() {
        backButton.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                module.getApplication().changeModule(M002Module.class, new Object[]{LoginView.DEP_TYPE});
            }
        });
    }

     private void initializeFormStrings() {
        
    }
}
